package advice;

import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;

/**
 * Created by fengtingxin on 2020/3/13.
 */
public class MyAfterReturningAdvice implements AfterReturningAdvice {

    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
        System.out.println("MyAfterReturningAdvice 后置增强 method is" + method.getName());

        if (args != null && args.length > 1){
            for (int i =0;i < args.length; i++){
                System.out.println("第" + i + "个参数为："+ args[i]);
            }
        }
        System.out.println("==目标类信息：" + target.toString());
    }
}
